import requests

try:
    url = "https://www.google.com"
    # timeout 设置请求超时时间
    response = requests.get(url, timeout=3)
    print(response.text)
except Exception as e:
    print("请求超时", e)
